package com.jsyh.maidu.adapter.home;

import android.content.Context;
import android.view.View;

import com.jsyh.maidu.R;
import com.jsyh.maidu.model.BestNewHot;

import java.util.List;

/**
 * Created by Administrator on 2017/6/8.
 */

public class RecommendHolder extends MyBaseViewHolder {
    private Context context;

    private MyGridView gridView;

    private List<BestNewHot> datas;
    GvJptjAdapter gvadapter;
    boolean loadmay = false;

    public RecommendHolder(View itemView, Context context, List<BestNewHot> datas) {
        super(itemView);
        this.context = context;
        this.datas = datas;

        gridView = (MyGridView) itemView.findViewById(R.id.home_goods_grid);
    }

    @Override
    public void bindData() {

        //判断是否需要重新请求
        if (!datas.isEmpty()) {
            //直接加载数据
            gvadapter = new GvJptjAdapter(context, datas);
            gridView.setAdapter(gvadapter);
            loadmay = true;
        }
    }

}
